﻿var Config = {
	Init: function () { 
		// do nothing
	}
};

var GoogleAnalyticsController = {
	Ready: function () {
		// do nothing
	}
};

var JavaScriptVariablesController = {
	Init: function () {
		// At this point the document is not ready.
		$(document).ready(function() {
			$("#Div6").text(ExistingLiteral.SomeInitValue);
		});
	},
	Ready: function () {
		// At this point the document is ready.
		$("#Div1").text(SomeGlobalVariable);
		$("#Div2").text(ExistingLiteral.SomeVariable);
		$("#Div3").text(ExistingLiteral.AnotherLiteral.SomeVariable);
		$("#Div4").text(NotExistingLiteral.SomeVariable);
		$("#Div5").text(JSON.stringify(NotExistingLiteral.AnotherNonExistingLiteral.SomeVariable));
	}
};

var JavaScriptFunctionsController = {
	Init: function () {
		// At this point the document is not ready.
		$(document).ready(function() {
			$("#Div1").text("The Init method has been called before the document was ready.");
		});
	},
	Ready: function () {
		// At this point the document is ready.
		$("#Div2").text("The Init method has been called after the document was ready.");
	},
	SomeFunction: function (intSomeNumber, bolSomeBoolean) {
		$("#Div4").text("Got " + intSomeNumber + " and " + bolSomeBoolean + " as arguments.");
	}
};

function SomeGlobalFunction(strToPrint) {
	$("#Div3").text("Got the following string to print: " + strToPrint);
}

var ExistingLiteral = {
	SomeVariable: undefined,
	SomeInitValue: undefined,
	AnotherLiteral: {
		SomeVariable: undefined
	}
};